SinglePoseDetectionModel

class SinglePoseDetectionModel(internalModel: OnnxInferenceModel, modelKindDescription: String?) : SinglePoseDetectionModelBase<Bitmap> , InferenceModel, CameraXCompatibleModel

SinglePoseDetectionModel is an ultra-fast and accurate model that detects 17 keypoints and 18 basic edges of a body.

It internally uses ONNXModels.PoseDetection.MoveNetSinglePoseLighting or ONNXModels.PoseDetection.MoveNetSinglePoseThunder under the hood to make predictions.

Parameters

internalModel

model used to make predictions

Constructors

SinglePoseDetectionModel
Link copied to clipboard
fun SinglePoseDetectionModel(modelBytes: ByteArray)

Constructs the pose detection model from a model bytes.

SinglePoseDetectionModel
Link copied to clipboard
fun SinglePoseDetectionModel(internalModel: OnnxInferenceModel, modelKindDescription: String? = null)

Functions

close
Link copied to clipboard
open override fun close()
convert
Link copied to clipboard
open override fun convert(output: OrtSession.Result): DetectedPose

Converts raw model output to the result.

copy
Link copied to clipboard
open override fun copy(copiedModelName: String?, saveOptimizerState: Boolean, copyWeights: Boolean): InferenceModel
detectPose
Link copied to clipboard
fun detectPose(image: Bitmap): DetectedPose

Detects a pose for the given image.

initializeWith
Link copied to clipboard
open override fun initializeWith(vararg executionProviders: ExecutionProvider)

Initialize the model with the specified executions providers.

predict
Link copied to clipboard
open override fun predict(inputData: FloatArray): Int
open fun predict(input: Bitmap): DetectedPose

Makes prediction on the given input.

predictSoftly
Link copied to clipboard
open override fun predictSoftly(inputData: FloatArray, predictionTensorName: String): FloatArray
reshape
Link copied to clipboard
open override fun reshape(vararg dims: Long)
summary
Link copied to clipboard
open override fun summary(): ModelSummary

Properties

inputDimensions
Link copied to clipboard
open override val inputDimensions: LongArray
internalModel
Link copied to clipboard
open override val internalModel: OnnxInferenceModel
modelKindDescription
Link copied to clipboard
open override val modelKindDescription: String?

High-level description of the model. Used for model summary printing. For the model hub models it equals to the string representation of the OnnxModelType

preprocessing
Link copied to clipboard
open override val preprocessing: Operation<Bitmap, Pair<FloatArray, TensorShape>>

Preprocessing operation specific to this model.

targetRotation
Link copied to clipboard
open override var targetRotation: Int = 0

Target image rotation.